package com.weixing.mall.provider.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.weixing.mall.provider.api.model.vo.ProductStockVo;
import com.weixing.mall.provider.api.model.vo.dto.RpcProductStockDto;
import com.weixing.mall.provider.model.domain.ProductStock;
import com.weixing.mall.provider.model.dto.ProductStockDto;
import com.weixing.mall.provider.model.dto.ProductStockSaveDto;
import com.weixing.mall.provider.model.query.ProductStockExistQuery;
import com.weixing.mall.provider.model.query.ProductStockQuery;
import com.weixing.mall.provider.model.vo.ProductStockListVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 仓库模块-商品库存表 服务类
 * </p>
 *
 * @author Small
 * @since 2019-11-15
 */
public interface IProductStockService extends IService<ProductStock> {

    IPage selectOfPage(Page page, ProductStockQuery productStockQuery);

    void saveList(ProductStockSaveDto productStockSaveDto, Long uid);

    Map<String,Object> totalQuantityAndAmount(ProductStockQuery productStockQuery);

    ProductStockVo selectProductStock(ProductStockExistQuery productStockExistQuery);

    Integer  getByGoodsInfo(Long  depotId, Long goodsId, Long productId);

    List<ProductStockVo> getAllByDepotId(Long  depotId);
    List<ProductStockVo> getAllAvaByDepotId(Long  depotId);
    void saveInitList(List<ProductStockDto> productStockDto, Long uid);

    List<ProductStockListVo> selectList(ProductStockQuery productStockQuery);

    void inStock(Long depotId, Long[] productIds);

    void inOutStock(Long depotId, Long productId,int flag,Long uid,String stock );

    void syncErpProductStock(List<RpcProductStockDto> list);

    void delSyncErpData(Long depotId);

}
